package uitl;

import java.io.IOException;

/**
 * @program: netty-dubbo-zhenghao
 * @description:
 * @author: Zheng Hao
 * @create: 2020-03-12 23:59
 */
public interface Serializer {
    /**
     *      * java对象转换为二进制
     *      *
     *      * @param object
     *      * @return
     *      
     */
    byte[] serialize(Object object) throws IOException;

    /**
     *      * 二进制转换成java对象
     *      *
     *      * @param clazz
     *      * @param bytes
     *      * @param <T>
     *      * @return
     *      
     */

    <T> T deserialize(Class<T> clazz, byte[] bytes) throws IOException;
}
